﻿using System.Collections.Generic;
using System.Runtime.Serialization;

namespace Sharpmark.MarkTweet.Services.Twitter
{
    [CollectionDataContract(Name = "users", ItemName = "user", Namespace = "")]
    public class Users : List<User> { }

    [DataContract(Name = "user", Namespace = "")]
    public class User
    {
        [DataMember(Name = "id")]
        public string Id { get; set; }

        [DataMember(Name = "name")]
        public string Name { get; set; }

        [DataMember(Name = "screen_name")]
        public string ScreenName { get; set; }

        [DataMember(Name = "location")]
        public string Location { get; set; }

        [DataMember(Name = "description")]
        public string Description { get; set; }

        [DataMember(Name = "profile_image_url")]
        public string ProfileImageUrl { get; set; }

        [DataMember(Name = "url")]
        public string Url { get; set; }

        public bool Protected { get; set; }
        [DataMember(Name = "protected")]
        private bool? ProtectedRaw
        {
            get { return Protected; }
            set { Protected = value ?? false; }
        }

        public int FollowersCount { get; set; }
        [DataMember(Name = "followers_count")]
        private int? FollowersCountRaw
        {
            get { return FollowersCount; }
            set { FollowersCount = value ?? 0; }
        }

        [DataMember(Name = "profile_background_color")]
        public string ProfileBackgroundColor { get; set; }

        [DataMember(Name = "profile_text_color")]
        public string ProfileTextColor { get; set; }

        [DataMember(Name = "profile_link_color")]
        public string ProfileLinkColor { get; set; }

        [DataMember(Name = "profile_sidebar_fill_color")]
        public string ProfileSidebarFillColor { get; set; }

        [DataMember(Name = "profile_sidebar_border_color")]
        public string ProfileSidebarBorderColor { get; set; }

        public int FriendsCount { get; set; }
        [DataMember(Name = "friends_count")]
        private int? FriendsCountRaw
        {
            get { return FriendsCount; }
            set { FriendsCount = value ?? 0; }
        }
        [DataMember(Name = "created_at")]
        public string CreatedAt { get; set; }

        public int FavouritesCount { get; set; }
        [DataMember(Name = "favourites_count")]
        private int? FavouritesCountRaw
        {
            get { return FavouritesCount; }
            set { FavouritesCount = value ?? 0; }
        }

        [DataMember(Name = "utc_offset")]
        public string UtcOffset { get; set; }

        [DataMember(Name = "time_zone")]
        public string TimeZone { get; set; }

        [DataMember(Name = "profile_background_image_url")]
        public string ProfileBackgroundImageUrl { get; set; }

        public bool ProfileBackgroundTile { get; set; }
        [DataMember(Name = "profile_background_tile")]
        private bool? ProfileBackgroundTileRaw
        {
            get { return ProfileBackgroundTile; }
            set { ProfileBackgroundTile = value ?? false; }
        }

        public int StatusesCount { get; set; }
        [DataMember(Name = "statuses_count")]
        private int? StatusesCountRaw
        {
            get { return StatusesCount; }
            set { StatusesCount = value ?? 0; }
        }

        public bool Notifications { get; set; }
        [DataMember(Name = "notifications")]
        private bool? NotificationsRaw
        {
            get { return Notifications; }
            set { Notifications = value ?? false; }
        }

        public bool Following { get; set; }
        [DataMember(Name = "following")]
        private bool? FollowingRaw
        {
            get { return Following; }
            set { Following = value ?? false; }
        }

        [DataMember(Name = "status")]
        public Status Status { get; set; }
    }

}
